<template>
  <div class="photoinfo">
    <header class="header">
      <div class="title">{{this.imgaUm.title}}</div>
      <div class="btn-groud">
        <span class="ctime">{{this.imgaUm.add_time}}</span>
        <span class="cclick">点击{{this.imgaUm.click}}次</span>
        <div class="ph-Img"></div>
      </div>
    </header>
    <hr>
    <div class="imgList">
      <img
        class="imags"
        v-for="img in imgList"
        :key="img.id"
        :src="img.src"
      >
    </div>
    <div class="imgContent">
      {{this.imgaUm.content}}
    </div>
    <comment></comment>
  </div>
</template>
<script>
// 引入组件
import comment from './../../../../components/comment'
export default {
  data: () => ({
    id: '',
    imgaUm: [],
    imgList: []
  }),
  created() {
    this.id = this.$route.params.id
    this.getimageInfo()
    this.getthumimages()
  },
  methods: {
    async getimageInfo() {
      try {
        const { data: { message } } = await this.Api.getimageInfo(this.id)
        // console.log(message)
        this.imgaUm = message
      } catch (error) {
        this.$Toasto('数据加载失败' + error.message)
      }
    },
    async getthumimages() {
      const { data: { message } } = await this.Api.getthumimages(this.id)
      console.log(message)
      this.imgList = message
    }
  },
  components: {
    comment
  }
}
</script>
<style lang="less" scoped>
.photoinfo{
  .header{
  display: block;
  // border-top: 1px solid #cccccc;
  padding-left: 10px;
  padding-right: 10px;
  .title{
    margin-bottom: 10px;
    margin-top: 10px;
    color: red;
    font-size: 18px;
  }
  .btn-groud{
    .ctime{
      color: skyblue;
      font-size: 14px;
      margin-left: 0;
    }
    .cclick{
      color: black;
      font-size: 14px;
      float: right;
    }
  }
}
  .imgList{
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
    .imags{
      width: 100px;
      height: 100px;
    }
  }
  .imgContent{
    font-size: 14px;
    margin-bottom: 20px;
  }
}
</style>
